package com.dlry.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "dl_branch")
public class DlBranch implements Serializable {

	/**
	 * 
	 */
	@Transient
	private static final long serialVersionUID = -1034344241836008345L;
	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	@Column(name = "name")
	private String name;
	@Column(name = "level")
	private Integer level;
	@OneToMany(targetEntity = DlLoginuser.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "branch")
	private List<DlLoginuser> users;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public List<DlLoginuser> getUsers() {
		return users;
	}

	public void setUsers(List<DlLoginuser> users) {
		this.users = users;
	}

	public DlBranch() {
	}

}
